﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebMainSite
{
    public partial class HeadControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MySite.Model.UserInfo userInfo = new MySite.Model.UserInfo();
                userInfo = Session["userInfo"] as MySite.Model.UserInfo;
                LbLoginName.Text = userInfo.UserID;
            }
        }
        /// <summary>
        /// 退出，关闭页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void LKLoginOut_Click(object sender, EventArgs e)
        {
            Session["userInfo"] = null;
            Session.Abandon();
            Response.Redirect("Login.aspx");
            //Response.Write("<script>window.opener=null;window.close();</script>");
        }
    }
}